home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
bc_ti
/
ti729.asc
< prev
next >
Wrap
Text File
|
1992-02-24
|
973b
|
67 lines
PRODUCT : Borland C++ NUMBER : 729
VERSION : 2.0
OS : DOS
DATE : February 25, 1992 PAGE : 1/1
TITLE : How to Use strstream
/*********************************************************
Example code for using strstream
*********************************************************/
#include <stdio.h> // the old C i/o stuff
#include <iostream.h> // C++ streams
#include <strstream.h>
char line[100]; // a buffer for lines of input
void main(void)
{
ostrstream mystream(line, 100); // associate line[] with a
stream
mystream << "testing"; // insertion to mystream
printf("%s\n", line); // output using old C style
cout << line; // output using C++ style
}